x86emul: replace UB shifts
authorJan Beulich <jbeulich@suse.com>
Fri, 7 Aug 2020 15:10:34 +0000 (17:10 +0200)
committerJan Beulich <jbeulich@suse.com>
Fri, 7 Aug 2020 15:10:34 +0000 (17:10 +0200)
commitafed8e4365f0dec26a040ea0670b654e00d8c869
treecd76126fdb9ebfc0ab95d8df20a22e5455aae7de
parenta5dab0a2453da1e15fd49e6a7fa9138e333ba9af
x86emul: replace UB shifts

Displacement values can be negative, hence we shouldn't left-shift them.
Or else we get

(XEN) UBSAN: Undefined behaviour in x86_emulate/x86_emulate.c:3482:55
(XEN) left shift of negative value -2

While auditing shifts, I noticed a pair of missing parentheses, which
also get added right here.

Reported-by: Andrew Cooper <andrew.cooper3@citrix.com>
Signed-off-by: Jan Beulich <jbeulich@suse.com>
Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>
Tested-by: Andrew Cooper <andrew.cooper3@citrix.com>
x86: comment update after "drop high compat r/o M2P table address range"

Commit 5af040ef8b57 clearly should also have updated the comment, not
just the #define-s.

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>
master commit: b6a907f8c83d37886d0523f1aeff61b98e133498
master date: 2020-07-31 17:41:58 +0200
master commit: 2e98d0b1d09e99e3d1287cb13f42b604ebc3c29a
master date: 2020-08-05 10:21:22 +0200
xen/arch/x86/x86_emulate/x86_emulate.c